package com.cn.xact.ty_treasured_book.sqlite;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class TYSqlliteHelper extends SQLiteOpenHelper {

    private static final String DATABASE_NAME = "ty_user.db";
    private static final int DATABASE_VERSION = 1;

    public TYSqlliteHelper(Context context) {
        super(context, DATABASE_NAME, null, DATABASE_VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase arg0) {
        arg0.execSQL("CREATE TABLE IF NOT EXISTS user" +
                "(_id INTEGER PRIMARY KEY AUTOINCREMENT, nick VARCHAR, login INTEGER, credit INTEGER, rank INTEGER)");
    }

    @Override
    public void onUpgrade(SQLiteDatabase arg0, int arg1, int arg2) {
        arg0.execSQL("ALTER TABLE user ADD COLUMN other STRING");
    }
}
